package com.igoal.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class UserJobId implements Serializable {

	private static final long serialVersionUID = 2460757181866811628L;
	private long userId;
	private long jobId;

	public UserJobId() {
	}

	public UserJobId(long userId, long jobId) {
		this.userId = userId;
		this.jobId = jobId;
	}

	@Column(name = "user_id", nullable = false)
	public long getUserId() {
		return this.userId;
	}

	public void setUserId(long userId) {
		this.userId = userId;
	}

	@Column(name = "job_id", nullable = false)
	public long getJobId() {
		return this.jobId;
	}

	public void setJobId(long jobId) {
		this.jobId = jobId;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof UserJobId))
			return false;
		UserJobId castOther = (UserJobId) other;

		return (this.getUserId() == castOther.getUserId())
				&& (this.getJobId() == castOther.getJobId());
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result + (int) this.getUserId();
		result = 37 * result + (int) this.getJobId();
		return result;
	}

}
